package com.heima.wemedia.controller;

import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.StatisticsDto;
import com.heima.wemedia.service.WmStatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 自媒体数据统计
 *
 * @author 11494
 * @version 1.0
 * @project heima-leadnews-group
 * @date 2024/1/28 09:03:04
 */
@Slf4j
@RestController
@RequestMapping("api/v1/statistics")
public class WmStatisticsController {
    @Autowired
    private WmStatisticsService wmStatisticsService;

    /**
     * @author 18297
     * @date 2024/1/28 17:21
     * @description 文章统计：图片发布量、文章点赞量、文章收藏量、文章点赞量
     * @param beginDate:
     * @param endDate:
     * @return ResponseResult
     */

    @GetMapping("/newsDimension")
    public ResponseResult newsDimension(String beginDate,String endDate){
        log.info("文章图文数据统计方法");
        return wmStatisticsService.newsDimension(beginDate,endDate);
    }
    /**
     * @author 18297
     * @date 2024/1/28 16:55
     * @description 分页展示文章列表,文章阅读、评论、收藏的数量
     * @param dto:
     * @return PageResponseResult
     */
    @GetMapping("/newsPage")
    public PageResponseResult newsPage(StatisticsDto dto){
        log.info("newsPage方法");
        return wmStatisticsService.newPage(dto);
    }
}
